package com.shihb.principle.singlerposibility;/**
 *Description:单一职责原则示范一
 *Version:1.0.0
 *@author shihb
 *@date 2020/6/23 19:34
 */
public class Demo1 {

  public static void main(String[] args) {
    Animal animal = new Animal();
    animal.run("金钱豹");
    animal.run("鸟");
    animal.run("鱼");
  }

}
/**
 *  违反了单一职责原则,如何优化看Demo2
 */
class  Animal {
  public void run(String animal){
    System.out.println(animal+"正在跑");
  }
}


